<!DOCTYPE html>
<html lang="cn">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style type="text/css"></style>
    <script>
        // window.onunload = function() {
        //     alert('你确定要关掉我吗??');
        // }
        window.onbeforeunload = function() {
            // alert('你确定要关掉我吗??');
            return '欧巴,别走';
        }
    </script>
</head>
<body>
    <h1>文档事件0.. - 关闭</h1>
    <hr>



    <script>
    
    </script>
</body>
</html>